﻿using System;
using System.Windows.Forms;
using aboveApplication;
using aboveXWords.GUI;

namespace aboveXWords
{
  internal class XWordDocument : Document
  {
    private readonly XWord m_xWord = new XWord(18, 24);

    public XWordDocument(string filename, Canvas canvas) : base(filename, canvas)
    {
      m_xWord.Canvas = canvas;
      m_xWord.Canvas.Dock = DockStyle.Fill;
    }

    internal void AddWord()
    {
      m_xWord.AddWord();
    }

    public void KeyPressed(KeyPressEventArgs keyPressEventArgs)
    {
      m_xWord.KeyPressed(keyPressEventArgs);
    }

    #region Delete

    public override bool CanDelete
    {
      get { return m_xWord.CanDelete; }
    }

    public override void DocumentPrintPage(System.Drawing.Printing.PrintPageEventArgs e)
    {
      m_xWord.Print(e);
    }

    public override void Delete()
    {
      m_xWord.Delete();
    }

    #endregion

    public void AddPicture()
    {
      m_xWord.AddPicture();
    }
  }
}